import service from '@/utils/crmRequest'

export default () => ({
  // ***************************** 财务 **********************************
  // 财务收款确认
  INTERNAL_CONTROL_FINANCE_PAYEE_CONFIRM: (data) => {
    return service({
      url: '/api/finance/rupdate-status',
      method: 'put',
      data
    })
  },
  // 分账列表 --- 货款、保证金(splitTypeFrom 1 货款 2 保证金 3 详情)
  INTERNAL_CONTROL_FINANCE_SPLIT_LIST: (data) => {
    return service({
      url: '/api/finance/split-list',
      method: 'post',
      data
    })
  },
  // 分账
  INTERNAL_CONTROL_FINANCE_SPLIT_CREATE: (data) => {
    return service({
      url: '/api/finance/split-create',
      method: 'post',
      data
    })
  },
  // 分账数据详情
  INTERNAL_CONTROL_FINANCE_SPLIT_DETAIL: (params) => {
    return service({
      url: '/api/finance/split-detail',
      method: 'get',
      params
    })
  },
  // 保证金处置
  INTERNAL_CONTROL_FINANCE_CASH_DEPOSIT_DEAL: (data) => {
    return service({
      url: '/api/finance/deal-margin',
      method: 'put',
      data
    })
  },
  // ----------------------------- 财务-信用管理 -----------------------------
  // 信用管理列表
  INTERNAL_CONTROL_FINANCE_CREDIT_LIST: (data) => {
    return service({
      url: '/api/credit/base/list',
      method: 'post',
      data
    })
  },
  // 信用管理详情
  INTERNAL_CONTROL_FINANCE_CREDIT_DETAIL: (data) => {
    return service({
      url: '/api/credit/neikong/detail',
      method: 'post',
      data
    })
  },
  // ------------------------- 商销客户资质 ---------------------------
  // 商销客户资质列表
  INTERNAL_CONTROL_SELLER_CUSTOMER_FILE_LIST: (data) => {
    return service({
      url: '/api/seller/internal-control/list',
      method: 'post',
      data
    })
  },
  // 商销客户资质列表
  INTERNAL_CONTROL_SELLER_CUSTOMER_FILE_DETAIL: (params) => {
    return service({
      url: '/api/seller/detail',
      method: 'get',
      params
    })
  },
  // 代理客户资质列表
  INTERNAL_CONTROL_AGENT_FILE_LIST: (data) => {
    return service({
      url: '/api/agent/internal-control/list',
      method: 'post',
      data
    })
  },
})
